
layui.define(['form', 'layedit', 'laydate', 'transfer'], function (exports) {
    let $ = layui.$;
    let form = layui.form;
    zmnLayUtil.layFormVerify(form);
    // 提交
    form.on('submit(zmn-service-group-form-submit)', function (obj) {
        let data = obj.field;
        $.ajax({
            async: false,
            type: "POST",
            url: "/service/group/addEdit.action",
            contentType: "application/json",
            dataType: "json",
            data: JSON.stringify(data),
            success: function (json) {
                if (json.status === 200) {
                    parent.reload(json.message);
                    cancel();
                }else {
                    parent.layer.msg(json.message,{"icon":2});
                }
            }
        });
        return false
    });
    //对外暴露的接口
    exports('serv_service_group_detail', {});
});

function cancel() {
    let index = parent.layer.getFrameIndex(window.name);
    parent.layer.close(index);
}